<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddSpendCaCustomers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('ca__customers', function (Blueprint $table) {
            $table->boolean('is_spend')->default(0)->comment('是否消费');
            $table->timestamp('spend_time')->nullable()->comment('消费时间');
            $table->index('spend_time', 'idx_spend_time');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('ca__customers', function (Blueprint $table) {
            $table->dropColumn('is_spend');
            $table->dropColumn('spend_time');
        });
    }
}
